package cn.gailvlun.gll.presentation.xroom.adapter

import android.app.Dialog
import android.content.Context
import cn.gailvlun.gll.R
import cn.gailvlun.gll.presentation.base.BaseActivity

open class BaseDialog : Dialog {
    constructor(context: Context?) : super(context, R.style.BaseDialog)

    private var isDismissed: Boolean = false

    open fun secureDismiss() {
        if (!isDismissed) {
            if (context is BaseActivity) {
                if (!(context as BaseActivity).isDestroyed) {
                    dismiss()
                }
            } else {
                dismiss()
            }
            isDismissed = true
        }
    }
}